using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using Microsoft.Phone.Controls;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class SnsLoadingTail : UserControl
	{
		private const string TAG = "SnsLoadingTail";
		private bool mBIsFirstLoaded = true;
		public bool mBIsLoaded;
		private EventWatcher mWatchxxx;
		private object mObjectWatcher;
		internal Grid LayoutRoot;
		internal PerformanceProgressBar progressBar;
		private bool _contentLoaded;
		public SnsLoadingTail()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.Control_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.Control_Unloaded));
		}
		private void Control_Loaded(object sender, RoutedEventArgs e)
		{
			this.mBIsLoaded = true;
			Log.smethod_5("SnsLoadingTail", "Control_Loaded");
		}
		private void Control_Unloaded(object sender, RoutedEventArgs e)
		{
			this.mBIsLoaded = false;
			Log.smethod_5("SnsLoadingTail", "Control_Unloaded");
		}
		private void registerEvent()
		{
			if (this.mWatchxxx == null)
			{
				this.mWatchxxx = new EventWatcher(this, null, new EventHandlerDelegate(this.Onxxx));
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchxxx);
			}
		}
		private void unRegisterEvent()
		{
			if (this.mWatchxxx != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchxxx);
				this.mWatchxxx = null;
			}
		}
		private void Onxxx(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (evtArgs == null)
			{
				return;
			}
		}
		public void SetStageLoading()
		{
			this.progressBar.set_Visibility(0);
			this.progressBar.IsIndeterminate = true;
		}
		public void SetStageDone()
		{
			this.progressBar.set_Visibility(1);
			this.progressBar.IsIndeterminate = false;
		}
		public void SetStageNone()
		{
			this.progressBar.IsIndeterminate = false;
			this.progressBar.set_Visibility(1);
		}
		public void SetStageNoMore()
		{
			this.progressBar.IsIndeterminate = false;
			this.progressBar.set_Visibility(1);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/Sns/Circle/UI/SnsLoadingTail.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.progressBar = (PerformanceProgressBar)base.FindName("progressBar");
		}
	}
}
